'''
Created on May 11, 2012

@author: nicole
'''

from SimDisMeasurment import *
from CrossValidation import *
from ReadWrite import *
from NearestNeighbor import *
from SimilarityEnum import *
from copy import *
import sys
if __name__ == '__main__':
    
    '''
    splitindex = 0
    
    data = readdict('../data/partition'+str(splitindex)+'.txt')
    
    print(data)
   
    '''
   
    data = readallid('../data/kaggle_visible_evaluation_triplets.txt')
    splitnumber = 55 #constant, don't change
    splitindex = 0 #from 0 to splitnumber -1
    
    

    if (len(sys.argv) > 1):
        splitindex = int(sys.argv[1])
    
    i1 = splitindex * len(data) / splitnumber
    i2 = (splitindex+1) * len(data) / splitnumber
        
    print i1, i2
    
    neighbordata = lightkNNforSplit(i1, i2, data)
    writeobject('../data/partition'+str(splitindex)+'.txt', neighbordata)
    